#include <iostream>
#include <functional>

using namespace std;

class GameCharacter;
int defaultHealthCalc(const GameCharacter &gc);
class GameCharacter
{
public:
    //typedef int (*HealthCalcFunc)(const GameCharacter&);
    typedef std::function<int (const GameCharacter&)> HealthCalcFunc;
    explicit GameCharacter(HealthCalcFunc hcf = defaultHealthCalc)
        :healthFunc(hcf)
    {}
    int healthValue() const
    {
        return healthFunc(*this);
    }
private:
    HealthCalcFunc healthFunc;
    
};

short calcHealth(const GameCharacter&);
struct HealthCalculator
{
    int operator () (const GameCharacter&) const;
};
class GameLevel
{
public:
    float health(const GameCharacter&) const;
};


void test()
{
    GameCharacter t1(calcHealth);
    GameCharacter t2(HealthCalculator);
    
    GameCharacter t3(
            std::bind(&GameLevel::health, GameLevel(), placeholders::_1)
            );
}

int main(int argc, char *argv[])
{
    return 0;
}
